import service from "@/utils/request.js";

const Api = {
  login: (params) => service.post(`/login`, params),
  getInfo: (params) => service.get(`/getInfo`, { params }),
  resetPwd: (params) => service.post(`/sys/user/resetPwd`, params),
  getCaptcha: (params) => service.get(`/captcha/acquire`, { params }),
  pageList: (params) => service.post(`/admin/news/pageList`, params),
  oneDetail: (id) => service.get(`/admin/news/query/${id}`),
  addCollect: (params) => service.post(`/admin/userCollection/add`, params),
  delCollect: (params) => service.post(`/admin/userCollection/delete`, {params}),
  addLike: (params) => service.post(`/admin/userLike/add`, params),
  delLike: (params) => service.post(`/admin/userLike/delete`, { params }),
  addFollow: (params) => service.post(`/admin/userFollow/add`, params),
  delFollow: (params) => service.post(`/admin/userFollow/delete`, {params}),
  addComment: (params) => service.post(`/admin/userComment/add`, params),
  commentList: (params) => service.post(`/admin/userComment/pageList`, params),
  addViews: (params) => service.post(`/admin/userBrowseHistory/add`, params),
  pageRecommendList: (params) =>
    service.post(`/admin/news/pageRecommendList`, params),
  feedbackList: (params) =>
    service.post(`/admin/userFeedback/pageList`, params),
  addFeedback: (params) => service.post(`/admin/userFeedback/add`, params),
  addHistory: (params) => service.post(`/admin/userSearchHistory/add`, params),
  historyList: (params) =>
    service.post(`/admin/userSearchHistory/pageList`, params),
  viewList: (params) =>
    service.post(`/admin/userBrowseHistory/pageList`, params),

  logout: (params) =>
      service.post(`/logout`, params),
};

export default Api;
